package Function;

import java.util.List;

import interfaces.DALException;
import dto_objects.BookDTO;
import dto_objects.FakturaDTO;
import dto_objects.UserDTO;

public class FunctionUSER extends FunctionWEB {
	
	public void updateOwnUser(UserDTO user) throws DALException{	
			SQLUser.updateUser(user);
	}
	
	public void loanBook(BookDTO book, FakturaDTO faktura) throws DALException{
		SQLBook.updateBook_Copy(book);
		SQLFaktura.createFaktura(faktura);
		
	}
	
	public void turnInBook(BookDTO book) throws DALException{
		SQLBook.updateBook_Copy(book);
		
	}
	
	public List<FakturaDTO> showCurrentLoans(int usrID, int action) throws DALException{
		return SQLFaktura.getFakturaByUsrID(usrID, action);
		
	}

}
